<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\PC\AuthController;
use App\Http\Controllers\PC\NoteController;
use App\Http\Controllers\PC\CityController;
use App\Http\Controllers\PC\JobController;
use App\Http\Controllers\PC\BusinessController;
use App\Http\Controllers\CommonDtController;
use App\Common\Upload;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::prefix('/pc')->group(function () {
    Route::get('/pinfo', [AuthController::class, 'checkSignature']);
    Route::post('/login', [AuthController::class, 'login']);
    Route::post('/s-code', [AuthController::class, 'sendSMS']);
    Route::get('/com-dt', [CommonDtController::class, 'commonDt']);
    Route::get('/check', [AuthController::class, 'checkMobile']);
    Route::get('/jump', [AuthController::class, 'redirectTo']);
    Route::get('/category/list', [BusinessController::class, 'getCategorys']);

    Route::group(['middleware' => 'pc.auth'], function () {
        Route::get('/u-info', [AuthController::class, 'info']);
        Route::post('/logout', [AuthController::class, 'logout']);
        Route::post('qn-token', [Upload::class, 'Upload']);
        Route::post('/bind', [AuthController::class, 'bindMobile']);
        Route::post('/c-resume', [NoteController::class, 'createResume']);
        Route::post('/dtl-resume', [NoteController::class, 'resumeDtl']);
        Route::post('/up-resume', [NoteController::class, 'resumeUpload']);
        Route::post('/analy-resume/{id}', [NoteController::class, 'resumeAnaly']);
        Route::post('/up-head', [NoteController::class, 'headUpload']);
        Route::delete('/edit-resume', [NoteController::class, 'delResume']);
        Route::put('/edit-resume', [NoteController::class, 'editResumeName']);
        Route::post('/deliver/job/{id}', [JobController::class, 'getDeliverJobs']);
        Route::get('/rec-jobs/{type}', [JobController::class, 'getRecruitJobNotes']);
        Route::get('/rec-jobs/dtl/{recruit_id}', [JobController::class, 'getRecruitJobNotesDtl']);
    });

    Route::group(['middleware' => 'cors'], function () {
        Route::get('/b-list', [BusinessController::class, 'BusinessList']);
        Route::get('/b-list/{id}', [BusinessController::class, 'getBusinessDt']);
        Route::get('/b-recruit/{id}', [BusinessController::class, 'getRecruitList']);
        Route::get('/city', [CityController::class, 'getCity']);
        Route::get('/job', [JobController::class, 'getJobs']);
        Route::get('/job/{id}', [JobController::class, 'getJobsDt']);
        Route::get('/all-city', [JobController::class, 'getAllCity']);
        Route::get('/location', [JobController::class, 'location']);
    });
});
